<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>{{count}}</strong></span>
    <ul class="filters">
      <li>
        <a :class="{selected:$store.state.isSell==='all'}" href="javascript:;" @click="proform('all')">全部</a>
      </li>
      <li>
        <a :class="{selected:$store.state.isSell==='no'}" href="javascript:;" @click="noproform('no')">未完成</a>
      </li>
      <li>
        <a :class="{selected:$store.state.isSell==='yes'}" href="javascript:;" @click="yesproform('yes')">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="clearAll">清除已完成</button>
  </footer>
</template>

<script>

export default {
  methods: {
    proform(e) {
      this.$store.commit('proform', e)
    },
    noproform(e) {
      this.$store.commit('noproform',e)
    },
    yesproform(e) {
      this.$store.commit('yesproform', e)
    },
    clearAll() {
      this.$store.commit('clearAll')
    }
  },
  computed: {
    count() {
    return this.$store.getters.showArr.length
  }
}
}
</script>
